/**
 * Created by Administrator on 2019/6/9.
 */

var t = document.querySelector(".main-cen-left");
var y = document.querySelector(".main-cen-left1");
var ce = document.querySelector(".ce");
var toTop = document.querySelector("#toTop");

window.onscroll = function () {
if (document.documentElement.scrollTop > 100 || document.body.scrollTop>100){
    t.style.position = "fixed";
    y.style.position = "static";
    ce.style.display="block";
}else {
    t.style.position = "static";
    y.style.position = "fixed";
    ce.style.display = "none";
}
    if (document.documentElement.scrollTop > 500|| document.body.scrollTop>500){
        toTop.style.display="block";
    }else {
        toTop.style.display = "none"
    }
    toTop.addEventListener('click',function () {
        window.scrollTo({
            top:0,
            behavior:'smooth'
        })
    })

}   